﻿<UserControl x:Class="VmroleAuthor.Views.ResExtDeploymentCredentialParameterView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:vw="clr-namespace:VmroleAuthor.Views"
             mc:Ignorable="d" 
            d:DesignWidth="600">
    <UserControl.Resources>       
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="24" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="24" />           
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition MinHeight="24" />          
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="6"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="6"/>
        </Grid.ColumnDefinitions>

        <Grid Grid.Row="1" Grid.Column="1" VerticalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column ="0" Text="{Binding Name}"  FontWeight="Bold" VerticalAlignment="Center"/>
            <TextBlock Grid.Column ="2" Text="UserName" FontWeight="Bold" VerticalAlignment="Center"/>
            <Button Grid.Column="4" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent">
                <Button.ToolTip>
                    <TextBlock Text="{Binding Description}"/>
                </Button.ToolTip>
                <StackPanel Orientation = "Horizontal">
                    <Image  Source="..\Img\Help.ico" Width="20" Height="20"></Image>
                </StackPanel>
            </Button>

        </Grid>

        <TextBox x:Name="UserNameValueName" Grid.Row="3" Grid.Column="1" Text="{Binding UserName, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" 
                 VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" ToolTip="{Binding ToolTipUserName}" Validation.ErrorTemplate="{x:Null}"/>


        <ContentPresenter Grid.Row="4" Grid.Column="1" Content="{Binding ElementName=UserNameValueName, Path=(Validation.Errors).CurrentItem}" />

        <Grid Grid.Row="5" Grid.Column="1" VerticalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="6"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column ="0" Text="{Binding Name}" FontWeight="Bold" VerticalAlignment="Center"/>
            <TextBlock Grid.Column ="2" Text="Password" FontWeight="Bold" VerticalAlignment="Center" />
            <Button Grid.Column="4" HorizontalAlignment="Left" Background="Transparent" BorderBrush="Transparent">
                <Button.ToolTip>
                    <TextBlock Text="{Binding Description}"/>
                </Button.ToolTip>
                <StackPanel Orientation = "Horizontal">
                    <Image  Source="..\Img\Help.ico" Width="20" Height="20"></Image>
                </StackPanel>
            </Button>
        </Grid>

        <PasswordBox x:Name="PwdValueName" Grid.Row="7" Grid.Column="1" 
                     vw:PasswordBoxAssistant.BindPassword="true" 
                     vw:PasswordBoxAssistant.BoundPassword="{Binding SecureOrPwd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnNotifyDataErrors=True,ValidatesOnDataErrors=True}"
                     VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" ToolTip="{Binding ToolTipPassword}" Validation.ErrorTemplate="{x:Null}"/>

        <ContentPresenter Grid.Row="8" Grid.Column="1" Content="{Binding ElementName=PwdValueName, Path=(Validation.Errors).CurrentItem}" />


        <TextBlock Grid.Row="9" Grid.Column="1"  Text="Confirm" FontWeight="Bold" VerticalAlignment="Center"/>
     
        <PasswordBox x:Name="ConfirmPwdValueName" Grid.Row="11" Grid.Column="1" 
                     vw:PasswordBoxAssistant.BindPassword="true"
                     vw:PasswordBoxAssistant.BoundPassword="{Binding ConfirmSecureOrPwd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True}"
                     VerticalAlignment="Center" VerticalContentAlignment="Center" Height="24" ToolTip="{Binding ToolTipConfirmPassword}" Validation.ErrorTemplate="{x:Null}"/>

        <ContentPresenter Grid.Row="12" Grid.Column="1" Content="{Binding ElementName=ConfirmPwdValueName, Path=(Validation.Errors).CurrentItem}" />

    </Grid>
</UserControl>
